<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>thymeleaf模板引擎</title>
</head>
<body>
<p th:text="${user.userName}"></p>
<p th:inline="text">[[${user.userName}]]<span>[</span>[[${user.gender}]]<span>]</span></p>
<p th:object="${user}">[[*{userName}]],[[*{gender}]]</p>
<a th:href="@{login.html}">国际化</a>
<hr/>
<p th:if="1==1">逻辑处理：if</ p>
<p th:unless="1 ne 1"> 逻辑处理：unless</p>
<p th:if="1!=1">逻辑处理：if</p>
<p th:unless="1 eq 1"> 逻辑处理：unless</p>
<ul th:switch="${role}">
    <li th:case="1">总经理</li>
    <li th:case="2">部门经理</li>
    <li th:case="*"> 普通员工</li>
</ul>
    <hr/>
    <!--便利 -->
    <table width="600" cellpadding="5" border="1">
        <tr>
            <th>序号</th>
            <th>用户名</th>
            <th>性别</th>
            <th>操作时间</th>
        </tr>
        <tr th:each="user,st:${list}">
            <td align="center">[[${st.count}]]</td>
            <td align="center">[[${user.userName}]]</td>
            <td align="center">[[${user.gender}]]</td>
            <td align="center">[[${#dates.format(user.operTime,'yyyy年MM月dd日 HH:mm:ss.SSS')}]]</td>
        </tr>
    </table>
<hr/>
<!--数字格式化-->
<p>[[${#numbers.formatDecimal(3.1415926,2,3)}]]</p>
<p>[[${#numbers.formatDecimal(999999999.5556,1,'COMMA',2,'POINT')}]]</p>
<p>[[${#strings.substring("123999999.5556",1,3)}]]</p>
<p>[[${#strings.length(message) le 9?message : #strings.substring(message,0,6)+'...'}]]</p>
</body>
</html>